package com.example.brain2;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainActivity extends Activity {

	public static final String ABOUT_MESSAGE = "basi mamata";
	public static final String NEW_GAME_MESSAGE = "maaani";

	private Button newGame;
	private Button aboutUs;
	private Button highScores;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		Effects.getInstance().init(this);

		newGame = (Button) findViewById(R.id.buttonNewGame);
		aboutUs = (Button) findViewById(R.id.buttonAboutUs);
		highScores = (Button) findViewById(R.id.buttonHighScores);

		// create a listener for all the buttons
		OnClickListener listener = new OnClickListener() {

			@Override
			public void onClick(View view) {
				switch (view.getId()) {
				case R.id.buttonNewGame:
					Effects.getInstance().playSound(Effects.SOUND_2);
					Intent intentNewGame = new Intent(MainActivity.this, ChooseThemeActivity.class);
					startActivity(intentNewGame);
					break;
				case R.id.buttonAboutUs :
					Effects.getInstance().playSound(Effects.SOUND_2);
					Intent intentAboutUs = new Intent(MainActivity.this, AboutUsActivity.class);
					startActivity(intentAboutUs);
					break;
				case R.id.buttonHighScores :
					Effects.getInstance().playSound(Effects.SOUND_2);
					Intent intentHighScores = new Intent(MainActivity.this, ChooseThemeActivity.class);
					startActivity(intentHighScores);
					break;
				}
			}
		};		
		newGame.setOnClickListener(listener);
		aboutUs.setOnClickListener(listener);
		highScores.setOnClickListener(listener);		
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

}
